﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Dashboard/Dashboard.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="JamesThew.Dashboard.Users" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Main" runat="server">
    <form id="form1" runat="server">
    <asp:GridView ID="GridViewUser" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="UserID" 
        DataSourceID="SqlDataSource1">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                ShowSelectButton="True" />
            <asp:BoundField DataField="UserID" HeaderText="UserID" InsertVisible="False" 
                ReadOnly="True" SortExpression="UserID" Visible="False" />
            <asp:BoundField DataField="UserLogin" HeaderText="UserLogin" 
                SortExpression="UserLogin" />
            <asp:BoundField DataField="UserPass" HeaderText="UserPass" 
                SortExpression="UserPass" />
            <asp:BoundField DataField="UserDisplayName" HeaderText="UserDisplayName" 
                SortExpression="UserDisplayName" />
            <asp:BoundField DataField="UserNickName" HeaderText="UserNickName" 
                SortExpression="UserNickName" />
            <asp:BoundField DataField="UserEmail" HeaderText="UserEmail" 
                SortExpression="UserEmail" />
            <asp:BoundField DataField="UserURL" HeaderText="UserURL" 
                SortExpression="UserURL" />
            <asp:BoundField DataField="UserRegistered" HeaderText="UserRegistered" 
                SortExpression="UserRegistered" />
            <asp:BoundField DataField="UserActivationKey" HeaderText="UserActivationKey" 
                SortExpression="UserActivationKey" />
            <asp:BoundField DataField="UserStatus" HeaderText="UserStatus" 
                SortExpression="UserStatus" />
            <asp:BoundField DataField="UserAddress" HeaderText="UserAddress" 
                SortExpression="UserAddress" />
            <asp:BoundField DataField="UserLevel" HeaderText="UserLevel" 
                SortExpression="UserLevel" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CMSConnectionString1 %>" 
        DeleteCommand="DELETE FROM [CMS_Users] WHERE [UserID] = @UserID" 
        InsertCommand="INSERT INTO [CMS_Users] ([UserLogin], [UserPass], [UserDisplayName], [UserNickName], [UserEmail], [UserURL], [UserRegistered], [UserActivationKey], [UserStatus], [UserAddress], [UserLevel]) VALUES (@UserLogin, @UserPass, @UserDisplayName, @UserNickName, @UserEmail, @UserURL, @UserRegistered, @UserActivationKey, @UserStatus, @UserAddress, @UserLevel)" 
        SelectCommand="SELECT * FROM [CMS_Users]" 
        UpdateCommand="UPDATE [CMS_Users] SET [UserLogin] = @UserLogin, [UserPass] = @UserPass, [UserDisplayName] = @UserDisplayName, [UserNickName] = @UserNickName, [UserEmail] = @UserEmail, [UserURL] = @UserURL, [UserRegistered] = @UserRegistered, [UserActivationKey] = @UserActivationKey, [UserStatus] = @UserStatus, [UserAddress] = @UserAddress, [UserLevel] = @UserLevel WHERE [UserID] = @UserID">
        <DeleteParameters>
            <asp:Parameter Name="UserID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="UserLogin" Type="String" />
            <asp:Parameter Name="UserPass" Type="String" />
            <asp:Parameter Name="UserDisplayName" Type="String" />
            <asp:Parameter Name="UserNickName" Type="String" />
            <asp:Parameter Name="UserEmail" Type="String" />
            <asp:Parameter Name="UserURL" Type="String" />
            <asp:Parameter Name="UserRegistered" Type="DateTime" />
            <asp:Parameter Name="UserActivationKey" Type="String" />
            <asp:Parameter Name="UserStatus" Type="String" />
            <asp:Parameter Name="UserAddress" Type="String" />
            <asp:Parameter Name="UserLevel" Type="Int32" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="UserLogin" Type="String" />
            <asp:Parameter Name="UserPass" Type="String" />
            <asp:Parameter Name="UserDisplayName" Type="String" />
            <asp:Parameter Name="UserNickName" Type="String" />
            <asp:Parameter Name="UserEmail" Type="String" />
            <asp:Parameter Name="UserURL" Type="String" />
            <asp:Parameter Name="UserRegistered" Type="DateTime" />
            <asp:Parameter Name="UserActivationKey" Type="String" />
            <asp:Parameter Name="UserStatus" Type="String" />
            <asp:Parameter Name="UserAddress" Type="String" />
            <asp:Parameter Name="UserLevel" Type="Int32" />
            <asp:Parameter Name="UserID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </form>
</asp:Content>
